package com.song.sshTemplate.action;

import org.hibernate.envers.Audited;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.opensymphony.xwork2.ActionSupport;
import com.song.sshTemplate.pojo.User;
import com.song.sshTemplate.service.UserService;

/**
 * @author 作者ryan_song E-mail:song316@gmai.com
 * @version 创建时间：2011-3-3 下午10:12:32
 * 类说明
 */
@SuppressWarnings("unused")
@Component("loginAction")
public class LoginAction extends ActionSupport{
	private static final long serialVersionUID = -6356307819518359036L;
	
	private String username;
	private String password;
	
	@Autowired
	@Qualifier("userService")
	private UserService userService;
	///////        
	public String loginAction(){
		
		User user = new User();
		user.setUsername(username);
		user.setPassword(password);
		userService.addUser(user);
		
		return "success";
	}

//	setter_getter
	
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
	
}
